package com.android.fragmentdemo
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.android.fragmentdemo.adapters.DynamicItem03Adapter
import com.hengfoxwolf.commonbase.base.BaseActivity3
import com.android.fragmentdemo.databeans.DataFactoryIp
import com.android.fragmentdemo.databinding.ActivityDefineNestedScrollBinding
import com.android.fragmentdemo.defineviews.List01DataItemDecoration

class DefineNestedScrollActivity :
    BaseActivity3<ActivityDefineNestedScrollBinding>(ActivityDefineNestedScrollBinding::inflate) {
    override fun init(savedInstanceState: Bundle?) {
        val dyAdapter = DynamicItem03Adapter()
        dyAdapter.itemDataSet = DataFactoryIp.createStrDataSet()
        mBinding.rvNested.apply {
            layoutManager = LinearLayoutManager(
                this@DefineNestedScrollActivity
            )
            adapter = dyAdapter
            addItemDecoration(
                List01DataItemDecoration(
                    this@DefineNestedScrollActivity,
                    0F
                    //resources.getDimension(R.dimen.dp_10)
                ).apply {
                    setDrawLastLine(false)
                })
        }

        val binderBundle = intent.extras
        if (binderBundle != null) {
            val binder = binderBundle.getBinder(FiledConstant.BINDER_DATA_LIST)
            if (binder is BinderDataTransfer) {
                val dataList = binder.mDataSet
            }
        }
    }
}